﻿using System;
using UnityEngine;
using UnityEngine.UI;

namespace GUITree
{
	// Token: 0x020004B2 RID: 1202
	public static class LayoutUtility
	{
		// Token: 0x06001E13 RID: 7699 RVA: 0x000BEAC8 File Offset: 0x000BCCC8
		public static float GetMinSize(ILayoutElement _element, int _axis)
		{
			return (_axis != 0) ? LayoutUtility.GetMinHeight(_element) : LayoutUtility.GetMinWidth(_element);
		}

		// Token: 0x06001E14 RID: 7700 RVA: 0x000BEAE4 File Offset: 0x000BCCE4
		public static float GetPreferredSize(ILayoutElement _element, int _axis)
		{
			return (_axis != 0) ? LayoutUtility.GetPreferredHeight(_element) : LayoutUtility.GetPreferredWidth(_element);
		}

		// Token: 0x06001E15 RID: 7701 RVA: 0x000BEB00 File Offset: 0x000BCD00
		public static float GetFlexibleSize(ILayoutElement _element, int _axis)
		{
			return (_axis != 0) ? LayoutUtility.GetFlexibleHeight(_element) : LayoutUtility.GetFlexibleWidth(_element);
		}

		// Token: 0x06001E16 RID: 7702 RVA: 0x000BEB1C File Offset: 0x000BCD1C
		public static float GetMinWidth(ILayoutElement _element)
		{
			return (_element != null) ? _element.minWidth : 0f;
		}

		// Token: 0x06001E17 RID: 7703 RVA: 0x000BEB34 File Offset: 0x000BCD34
		public static float GetPreferredWidth(ILayoutElement _element)
		{
			return (_element != null) ? Mathf.Max(Mathf.Max(_element.minWidth, _element.preferredWidth), 0f) : 0f;
		}

		// Token: 0x06001E18 RID: 7704 RVA: 0x000BEB64 File Offset: 0x000BCD64
		public static float GetFlexibleWidth(ILayoutElement _element)
		{
			return (_element != null) ? _element.flexibleWidth : 0f;
		}

		// Token: 0x06001E19 RID: 7705 RVA: 0x000BEB7C File Offset: 0x000BCD7C
		public static float GetMinHeight(ILayoutElement _element)
		{
			return (_element != null) ? _element.minHeight : 0f;
		}

		// Token: 0x06001E1A RID: 7706 RVA: 0x000BEB94 File Offset: 0x000BCD94
		public static float GetPreferredHeight(ILayoutElement _element)
		{
			return (_element != null) ? Mathf.Max(Mathf.Max(_element.minHeight, _element.preferredHeight), 0f) : 0f;
		}

		// Token: 0x06001E1B RID: 7707 RVA: 0x000BEBC4 File Offset: 0x000BCDC4
		public static float GetFlexibleHeight(ILayoutElement _element)
		{
			return (_element != null) ? _element.flexibleHeight : 0f;
		}
	}
}
